<template>
  <div>
    <el-form>
      <div class="box">
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item :to="{ path: '/' }">盛世绿能招投标系统</el-breadcrumb-item>
          <el-breadcrumb-item :to="{ path: '/noticeList' }">招标公告</el-breadcrumb-item>
          <el-breadcrumb-item v-if="infos">{{ infos.uTitle }}</el-breadcrumb-item>
        </el-breadcrumb>
        <div class="my-basic-grid-content">
          <h1 style="text-align: center;padding-top: 20px;" v-if="infos">{{ infos.uTitle }}</h1>
          <el-row>
            <el-col :span="21">
              <div class="my-left-box">
                <el-descriptions  class="margin-top" title="标案信息" :column="3" :size="size" border>
                  <el-descriptions-item >
                    <template slot="label" >
                      招标编号
                    </template>
                    {{infos ? infos.bidTender.sCode : ''}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      采购计划
                    </template>
                    {{infos ? infos.uProject : ''}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      招标单位
                    </template>
                    {{infos ? infos.bidTender.sUnit : ''}}
                  </el-descriptions-item>

                  <el-descriptions-item >
                    <template slot="label" >
                      公告发布时间
                    </template>
                    {{infos && infos.uUpdateTime}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      数量
                    </template>
                    {{infos && infos.theNumber}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      是否含税
                    </template>
                    {{infos && infos.taxIncluded === 1 ? "含税":"未税"}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      招标方式
                    </template>
                    {{infos && infos.bidTender.sWay === 1 ? "公开招标":"邀请招标"}}
                  </el-descriptions-item>
                  <el-descriptions-item>
                    <template slot="label" >
                      招标类别
                    </template>
                    {{infos && infos.bidTender.sType === 1 ? "公司项目采购":"对外销售采购"}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      保证金
                    </template>
                    {{infos && (infos.deposit === null || infos.deposit < 0 ? '无' : infos.deposit)}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      标书获取时间
                    </template>
                    {{infos && infos.uGetTime}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      接受答疑时间
                    </template>
                    {{infos && infos.uAcceptTime}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      报名截止时间
                    </template>
                    {{infos && infos.registrationEndTime}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      付款方式
                    </template>
                    {{infos && infos.payMethod}}
                  </el-descriptions-item>
                </el-descriptions>
              </div>
            </el-col>
            <el-col :span="3">
              <div class="my-right-box">
<!--                <el-image style="width: 290px;height: 78px;margin-top: 50px;margin-left: 70px;" src="../images/arrow_02.png"></el-image>-->
<!--                <el-button class="btn-tb" @click="biddingPrice('tb')" v-if="types === 'bidNotice' && isRead==='0'" id="tb">点击这里进行投标</el-button>
                <el-button class="btn-tb" v-if="types === 'bidNotice' && isRead==='1'" id="tb">投标截至</el-button>
                <el-button class="btn-tb" v-if="types === 'winning'" id="tb">投标截至</el-button>-->
                <p>
                  <el-button type="primary" v-if="canRegistration" @click="biddingPrice('cy')">报名参与</el-button>
                  <el-button type="primary" v-if="!canRegistration" style="background-color: #9d9d9d;border-color: #9d9d9d;" :disabled="true">报名已截止</el-button>
                </p>
                <p>
                  <el-button type="primary" v-if="canBidding" @click="biddingPrice('tb')" style="background-color: yellowgreen;border-color: yellowgreen;">点击投标</el-button>
                  <el-button type="primary" v-if="!canBidding" style="background-color: #9d9d9d;border-color: #9d9d9d;" :disabled="true">投标已截止</el-button>
                </p>
                <p>
                  <el-button type="danger" @click="biddingPrice('jb')">去竞价</el-button>
                </p>
                <el-dialog :visible.sync="dialogVisible" width="650px">
                  <Login @update:visible="handleDialogVisibleChange"></Login>
                </el-dialog>
              </div>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="21">
              <div class="my-left-box" style="margin-top: 25px;">
                <el-descriptions  class="margin-top" title="竞标规则" :column="3" :size="size" border>
                  <el-descriptions-item >
                    <template slot="label" >
                      竞价类别
                    </template>
                    {{biddingRules.priceCategory}}
                  </el-descriptions-item>
                  <el-descriptions-item span="2">
                    <template slot="label" >
                      竞标类别
                    </template>
                    {{biddingRules.biddingCategory}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      投标截止时间
                    </template>
                    {{infos && infos.uEndTime}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      竞标开始时间
                    </template>
                    {{infos && infos.uKaiTime}}
                  </el-descriptions-item>
                  <el-descriptions-item >
                    <template slot="label" >
                      竞标结束时间
                    </template>
                    {{infos && infos.uKaiEndTime}}
                  </el-descriptions-item>
                  <el-descriptions-item span="3">
                    <template slot="label" >
                      竞标方式
                    </template>
                    {{biddingRules.biddingMethod}}
                  </el-descriptions-item>
                  <el-descriptions-item>
                    <template slot="label" >
                      联系人
                    </template>
                    {{infos.bidTender.sPerson}}
                  </el-descriptions-item>
                  <el-descriptions-item>
                    <template slot="label" >
                      电话
                    </template>
                    {{infos.bidTender.sPhone}}
                  </el-descriptions-item>
                  <el-descriptions-item>
                    <template slot="label" >
                      邮箱
                    </template>
                    {{infos.bidTender.email}}
                  </el-descriptions-item>

                </el-descriptions>
              </div>
            </el-col>
          </el-row>
          <p style="border-left: solid 5px;border-color: #0065b5 !important;margin-top:25px;margin-left: 20px;padding-left: 7px;font-size: 16px;font-weight: 600;">标案公告</p>
          <el-tabs v-model="activeName" type="border-card" style="box-shadow:none;margin: 20px 20px 10px;">
            <el-tab-pane label="标案公告详情" id="t1" name="bidNotice">
              <el-empty :image-size="200" v-if="infos == null"></el-empty>
              <editor v-model="infos.fjRemark" v-if="infos" :min-height="192"/>
              <el-button type="primary" size="small" @click="biddingPrice('xz')">招标附件下载<i class="el-icon-download el-icon--right"></i>
              </el-button>
              <div v-for="(it,index) in files"
                   style="font-size: 13px;color: #0065B5;margin: 10px 10px;">
                {{ index + 1 }}、{{ it.name }}
              </div>
            </el-tab-pane>
<!--            <el-tab-pane label="中标候选人公示" id="t2" name="candidate">
              <el-empty :image-size="200" v-if="candidateList.length === 0"></el-empty>
              <el-table v-if="candidateList.length > 0" :data="candidateList" :default-sort = "{prop: 'zRanking', order: 'ascending'}">
                <el-table-column label="序号" type="index" align="center" />
                <el-table-column label="供应商名称" align="center" prop="hName" width="380">
                  <template slot-scope="scope">
                    <span>{{ scope.row.hName || '——' }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="排名" align="center" prop="zRanking" sortable>
                  <template slot-scope="scope">
                    <span>{{ scope.row.zRanking || '——' }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="最终报价(元)" align="center" prop="zFinal">
                  <template slot-scope="scope">
                    <span>{{ scope.row.zFinal || '——' }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="最终得分" align="center" prop="zFraction">
                  <template slot-scope="scope">
                    <span>{{ scope.row.zFraction || '——' }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="是否推荐" align="center" prop="zRecommend" >
                  <template slot-scope="scope">
                    <span>{{scope.row.zRecommend === 0 ?'是':'否'}}</span>
                  </template>
                </el-table-column>
                <el-table-column label="是否中标" align="center" prop="zBidder" >
                  <template slot-scope="scope">
                    <span>{{scope.row.zBidder === 0 ?'是':'否'}}</span>
                  </template>
                </el-table-column>
                <el-table-column label="详情" type="expand" width="180">
                  <template slot-scope="scope">
                    <el-form label-position="left" inline class="demo-table-expand">
                      <el-form-item label="供应商详情">
                        <el-form-item label="供应商名称">
                          <span>{{ scope.row.hName || '——' }}</span>
                        </el-form-item>
                        <el-form-item label="经营产品">
                          <span>{{ scope.row.bsSuppliers[0].hInstitution || '——' }}</span>
                        </el-form-item>
                        <el-form-item label="成立日期">
                          <span>{{ scope.row.bsSuppliers[0].hStartTime || '——' }}</span>
                        </el-form-item>
                        <el-form-item label="法人">
                          <span>{{ scope.row.bsSuppliers[0].hJuridical || '——' }}</span>
                        </el-form-item>
                        <el-form-item label="单位联系地址">
                          <span>{{ scope.row.bsSuppliers[0].hAddress || '——' }}</span>
                        </el-form-item>
                        <el-form-item label="经营范围">
                          <span>{{ scope.row.bsSuppliers[0].hRange || '——' }}</span>
                        </el-form-item>
                        <el-form-item label="注册资本">
                          <span>{{ scope.row.bsSuppliers[0].hCapital || '——' }}万元</span>
                        </el-form-item>
                        <el-form-item label="公司简介">
                          <span>{{ scope.row.bsSuppliers[0].hDesc || '——' }}</span>
                        </el-form-item>
                      </el-form-item>
                    </el-form>
                  </template>
                </el-table-column>
              </el-table>
              <span style="color: red;">展开表格行的“详情”列的>按钮可以查看更多信息</span>
            </el-tab-pane>-->
            <el-tab-pane label="中标结果公示" id="t3" name="winning">
              <el-empty :image-size="200" v-if="winningList == null"></el-empty>
              <editor v-model="winningList.resultDesc" v-if="winningList" :min-height="192"/>
            </el-tab-pane>
          </el-tabs>
        </div>
      </div>
      <HomeFloor></HomeFloor>
    </el-form>

    <el-dialog
        title="上传报价文件"
        :visible.sync="centerDialogVisible"
        width="30%"
        center>
      <span>
          <el-form>
            <el-form-item label="起始报价：" prop="startPrice">
              <span>(注意：竞标时，该值将用作供应商提供的“初次报价”来竞标)</span>
              <el-input v-model="startPrice" placeholder="请输入起始报价" clearable :style="{width: '45%'}"></el-input><span style="color: red;">（注：含增值税，单位：{{ currencyUnit }}，币别：{{ currencyCategory }}）</span>
            </el-form-item>
            <el-form-item label="附件：" prop="fjAnnex">
                      <el-upload ref="upload" class="upload-demo" :limit="5" accept=".doc, .docx, .pdf, .xls, .xlsx, .rar, .txt, .png, .jpg, .zip"
                                 :max-size="104857600"
                                 :action="upload.url"
                                 :on-change="changeFileLength"
                                 :headers="upload.headers" :file-list="upload.fileList" :before-remove="beforeRemove"
                                 :multiple="true"
                                 :on-progress="handleFileUploadProgress"
                                 :before-upload="beforeUpload"
                                 :on-success="handleFileSuccess" :auto-upload="false">
                        <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<!--                                                <el-button style="margin-left: 10px;" size="small" type="success" :loading="upload.isUploading"-->
<!--                                                           @click="submitUpload">上传文件-->
<!--                                                </el-button>-->
                        <div slot="tip" class="el-upload__tip" style="font-size: 14px;">只能上传.doc，.docx，.pdf，.xls，.xlsx，.rar，.txt，.png，.jpg文件，可以多选</div>
                      </el-upload>
            </el-form-item>
          </el-form>
      </span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="centerDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitUpload">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {getList, findAllByEndTime, findTwoInfo, downloadZip, getSubmissionInfo} from '@/api/home'
import {addSubmission,listSubmission,updateTender} from "@/api/submission";
import Login from '@/components/login/Login.vue'
import Editor from "@/components/Editor/index.vue";
import HomeFloor from "@/components/home/HomeFloor.vue";
import {getToken} from "@/utils/auth";
import modal from "@/plugins/modal";
import {listCandidate,suppCand} from "@/api/system/candidate";
import {getSupplier} from "@/api/system/supplier";
import {listResults,selectResultAndCandidate} from "@/api/system/winningResult";
import {delRegistration, findBiddingRule, findBiddingRuleBySid, getRegistration, gotoRegistration} from "@/api/system/tender";

export default {
  name: 'NoticeDetail',
  components: {HomeFloor, Editor, 'Login': Login},
  data() {
    return {
      size:"0",
      types:null,
      isRead: "0",
      sid:null,
      activeName:'bidNotice',
      centerDialogVisible: false,
      startPrice: null,
      currencyUnit: '',
      currencyCategory: '',
      loading: false,
      canRegistration: true,
      canBidding: true,
      infos: {
        bidTender:{
          sCode:null,
          sUnit:null,
          sWay:null,
          sType:null,
        },
        fjAnnex:[],
      },
      biddingRules:{

      },
      notices: null,
      supplier:null,
      submission:{
        sid:null,
        hid:null,
        fjFiles:null,
        startPrice:null,
        currencyUnit:null,
        currencyCategory:null,
      },
      addByRegistration:{
        sid:null,
        sCode:null,
        uid:null,
        hid:null,
        currentStatus:null,
      },
      queryParams: {
        uid: null,
        uTitle: null
      },
      //中标候选人
      queryParams2: {
        pageNum: 1,
        pageSize: 10,
        sid: null,
        zBname: null,
        zFinal: null,
        zFraction: null,
        zRecommend: null,
        zRanking: null,
        zSign: null,
        zCensor: null,
        zReview: null,
        zSummary: null,
        zBidder: null,
        zSendTime: null
      },
      queryParams3:{
        sid:0,
        sCode:null,
        sName:null,
        sWay: null,
        sMust:null,
        sSway:null,
        sType: null,
        sBudget:null,
        sUnit:null,
        sPerson:null,
        sPhone:null,
        email:null,
        sAddress:null,
        fjFiles:null,
        sProjectState:null,
        sLeader:null,
      },
      candidateList:[],
      winningList:null,
      files:[],
      dialogVisible: false,
      fullscreenLoading: false,
      //附件
      fileList:[],
      // 收集——上传文件的列表
      uploadFiles: [],
      // 收集——上传文件的个数
      filesLength: 0,
      //收集已上传的文件名
      fileNameList:[],
      urls:[],
      fjList:[],
      //未上传前文件列表
      noFiles:[],
      //未上传清除后文件列表
      noFiles2:[],
      // 上传参数
      upload: {
        // 上传的文件列表
        fileList: [],
        // 是否禁用上传
        isUploading: false,
        // 设置上传的请求头部
        headers: {
          Authorization: "Bearer " + getToken()
        },
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/bidding/documents/upload1",
      }
    }
  },
  created() {
    this.types = this.$route.query.type;
    this.activeName = this.$route.query.type;
    this.isRead = this.$route.query.read;
    //if(this.activeName === 'winning'){
      this.queryParams2.sid = this.$route.query.sid;
      if(this.queryParams2.sid !== null){
        suppCand(this.queryParams2.sid).then(res=>{
          this.candidateList = res.data.data;
        });
        this.resultInfo(this.queryParams2.sid);
        //查询看有没有竞标规则
        findBiddingRuleBySid(this.$route.query.sid).then(response=>{
          if(response.data && response.data.data){
            this.biddingRules = response.data.data;
            this.currencyCategory = this.biddingRules.currencyCategory;
            this.currencyUnit = this.biddingRules.currencyUnit;
          }else{
            this.currencyCategory = 'RMB';
            this.currencyUnit = '元';
          }
        });
      }
    //}
    this.queryParams.uid = this.$route.query.uid;//拿到参数----公告ID
    this.Info(this.queryParams.uid);
    this.openFullScreen1();
    this.hqInfo();
  },
  methods: {
    resultInfo(sid){
      let bsSupplier = sessionStorage.getItem("bsSupplier");
      let hid = 0;
      if(bsSupplier){
        hid = JSON.parse(bsSupplier).hid;//拿到供应商id
      }
      selectResultAndCandidate(sid,hid).then(res=>{
           this.winningList = res.data.data;
      });
    },
    hqInfo() {
      getList(this.queryParams).then(r => {
        this.notices = r.data.rows[0];
        if(r.data.rows[0]){
          this.notices["results"] = r.data.rows[0].results;
          this.submission.sid = this.notices.sid;
        }
      });
    },
    Info(uid) {
      findTwoInfo(uid).then(res => {
        this.infos = res.data.data;
        if(res.data.data){
          //this.$router.push("/noticeList")
          const endTime = this.infos.registrationEndTime + '';
          const biddingEndTime = this.infos.uEndTime + '';
          const now = new Date().getTime();
          const otherDate = new Date(endTime).getTime();
          if(now > otherDate){
            this.canRegistration = false;
          }
          const otherBiddingEndTime = new Date(biddingEndTime).getTime();
          console.log(otherBiddingEndTime)
          console.log(now)
          if(now > otherBiddingEndTime){
            this.canBidding = false;
          }
        }else{
          this.infos = null;
          modal.alertError("公告不存在或已更新，请到公告列表查看！");
        }
        if(this.infos !== undefined && this.infos && (this.infos.fjAnnex != null || this.infos.fjAnnex !== undefined)){
          this.files =  JSON.parse(this.infos.fjAnnex);
        }
      });
    },
    openFullScreen1() {
      this.fullscreenLoading = true;
      setTimeout(() => {
        this.fullscreenLoading = false;
      }, 1500);
    },
    biddingPrice(type) {
      if (sessionStorage.getItem('token') == null) {
        this.dialogVisible = true;
      } else {
        this.submission.hid = JSON.parse(sessionStorage.getItem("bsSupplier")).hid;//拿到供应商id
        if (type === 'tb') {
          //投标
          getRegistration(this.notices.sid,this.submission.hid).then(response=>{
            if(response.data && response.data.data){
              if(this.notices.sid === response.data.data.sid && this.submission.hid === response.data.data.hid){
                //判断该供应商是否已投标
                listSubmission(this.submission).then(res=>{
                  if(res.data.rows.length  === 0){
                    //查询看有没有竞标规则
                    findBiddingRule(this.notices.sid,this.submission.hid).then(response=>{
                      if(response.data && response.data.data){
                        const bidPriceRule = response.data.data;
                        this.currencyCategory = bidPriceRule.currencyCategory;
                        this.currencyUnit = bidPriceRule.currencyUnit;
                      }else{
                        this.currencyCategory = 'RMB';
                        this.currencyUnit = '元';
                      }
                    });
                    //打开上传标书
                    this.$confirm('是否确认要投标？', '消息', {
                      confirmButtonText: '确定',
                      cancelButtonText: '取消',
                      type: 'warning'
                    }).then(() => {
                      this.centerDialogVisible = true;//打开弹出框
                    }).catch(() => {
                      return false
                    });
                  }else{
                    modal.alertError("您已参与该项目投标，请勿反复投标，请进入“供应商中心”查看！");
                  }
                });
              }
            }else{
              //提示先去报名
              modal.alertError("您还没报名参加竞标该项目！");
            }
          });
        } else if(type === 'cy'){
          //报名参与
          getRegistration(this.notices.sid,this.submission.hid).then(response=>{
            if(response.data && response.data.data && response.data.data.currentStatus === 1){
              console.log(response.data.data)
              if(this.notices.sid === response.data.data.sid && this.submission.hid === response.data.data.hid){
                modal.alertError("您已报名竞标该项目！");
              }
            }else{
              //去报名
              this.$confirm('是否确认要报名？', '消息', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
              }).then(() => {
                this.addByRegistration.sid = this.notices.sid;
                this.addByRegistration.sCode = this.infos.bidTender.sCode;
                this.addByRegistration.uid = this.notices.uid;
                this.addByRegistration.hid = this.submission.hid;
                this.addByRegistration.currentStatus = 1;
                gotoRegistration(this.addByRegistration).then(response=>{
                  if(response.data && response.data.code === 200){
                    this.$message.success("报名成功！")
                  }else{
                    this.$message.error("报名失败，请核实报名截止时间！")
                  }
                });
              }).catch(() => {
                return false
              });
            }
          });
        }  else if(type === 'jb'){
          //竞标
          const sid = this.notices.sid;
          const uid = this.notices.uid;
          const xyId = this.notices.xyId;
          getSubmissionInfo(sid,this.submission.hid).then(res => {
            if(res.data.code === 200){
              this.$router.push('/goBidding?uid='+ uid+'&sid='+ sid + '&xyId=' + xyId +'&type=bidNotice&read=1');
            }else{
              modal.alertWarning("未投标不能竞价")
            }
          })
        } else if (type === 'xz') {
          //拿到登录后的供应商Id
          // console.log(JSON.parse(sessionStorage.getItem("bsSupplier")).hid)
          //拿到招标项目Id
          //下载
          this.notices.fjAnnex = null;
          this.notices.fjRemark = null;
          this.notices.hid = JSON.parse(sessionStorage.getItem("bsSupplier")).hid;//拿到供应商id
          const url = process.env.VUE_APP_BASE_API + `/bidding/tenderFile/downloadZip?obj=${encodeURIComponent(JSON.stringify(this.notices))}`;
          const a = document.createElement('a')
          a.setAttribute('target', '_blank')
          a.setAttribute('href', url)
          a.click()
        }
      }
    },
    handleDialogVisibleChange(newValue) {
      this.dialogVisible = newValue;
    },
    // 文件提交处理
    submitUpload() {
      if(!this.isInputDigits(this.startPrice)){
        this.$message.warning('请输入起始报价！');
        return;
      }
      if(!this.isAllDigits(this.startPrice)){
        this.$message.warning('请输入正确的起始报价！');
        return;
      }
      //上传标书以及后续操作
      this.$refs.upload.submit();
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
    },
    // 修改当前文件列表长度
    changeFileLength(file, fileList){
      this.noFiles.push(file);
      this.filesLength = fileList.length;
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      const url =response.data.data.url;
      this.urls.push({id: this.urls.length + 1, url});
      this.fjList.push({id: this.fjList.length + 1, ...file });
      this.uploadFiles.push(file);
      //每上传完一个文件都会执行该函数，所以必须等上传完成后再提交表单
      if (this.uploadFiles.length === this.filesLength){
        //清空未上传文件列表
        this.noFiles2=[];
        let fjLists = this.fjList.map(obj=>{
          let newObj = obj;
          delete newObj.percentage;
          delete newObj.raw;
          delete newObj.status;
          delete newObj.response;
          obj.url = '';
          return newObj;
        });
        const result = fjLists.map((item, index) => {
          item.url = this.urls[index].url;
          return item;
        });
        this.submission.sid = this.notices.sid;//招标项目id
        this.submission.fjFiles = JSON.stringify(result);//投标书
        this.submission.startPrice = this.startPrice;
        this.submission.currencyUnit = this.currencyUnit;
        this.submission.currencyCategory = this.currencyCategory;
        //添加投递标书供应商
        if(this.submission.sid != null && this.submission.fjFiles!=null){
          addSubmission(this.submission).then(res=>{
            if(res.data && res.data.code === 200){
              this.submission.fjFiles = null;//投标书清空
              this.submission.hid = null;//投标书清空
              this.submission.startPrice = null;
              this.submission.currencyUnit = null;
              this.submission.currencyCategory = null;
              this.submission.sid = null;//招标项目id清空
              this.upload.fileList = [];
              this.startPrice = null;
              this.currencyUnit = null;
              this.currencyCategory = null;
              modal.msgSuccess("投标成功！");
            }else{
              this.$message.error("投标失败，请核实投标截止时间！")
            }
          });
        }
      }
      this.centerDialogVisible = false;
      this.upload.isUploading = false;
    },
    beforeRemove(file, fileList) {
      this.noFiles2 =  this.noFiles.filter(f=>f.name !== file.name);
      return this.$confirm(`确定移除 ${file.name}？`);
    },
    beforeUpload(file) {
      const isLt5M = file.size / 1024 / 1024 < 100;
      if (!isLt5M) {
        this.$message.error('文件大小不能超过100MB');
      }
      return isLt5M;
    },
    isInputDigits(input) {
      // 处理null、undefined和非字符串输入
      if (input === null || input === undefined) {
        return false;
      }
      // 转换为字符串处理
      const str = String(input);
      // 空字符串不算全数字
      if (str.length === 0) {
        return false;
      }
      return true;
    },
    isAllDigits(input) {
      // 处理null、undefined和非字符串输入
      if (input === null || input === undefined) {
        return false;
      }
      // 转换为字符串处理
      const str = String(input);
      // 空字符串不算全数字
      if (str.length === 0) {
        return false;
      }
      // 使用正则表达式检查是否全部为数字
      return /^\d+$/.test(str);
    }
  }
}
</script>
<style>
.box {
  width: 1400px;
  margin: 10px auto;
}

.my-basic-grid-content {
  background-color: white;
  margin-top: 20px;
  height: auto;
  width: 1400px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  padding-bottom: 10px;
}

.my-left-box {
  height: auto;
  margin-top: 0px;
  margin-left: 20px;
  font-size: 15px;
}

.my-left-box .span {
  color: #0065B5;
}
.my-left-box p {
  margin: 10px 0;
}

.btn-tb2{
  position: absolute;
  top: 65px;
  left: 118px;
  color: #0065B5;
}

.el-descriptions__title {
  font-size: 16px;
  font-weight: 700;
  border-left: solid 5px;border-color: #0065b5 !important;padding-left: 7px;
}

.my-right-box {
  position: relative;
  padding-top: 28px;
  padding-left: 20px;
}
#t1,#t2,#t3{
  font-size: 17px
}
 .demo-table-expand {
   font-size: 0;
 }
.demo-table-expand label {
  width: 120px;
  color: #99a9bf;
}
.demo-table-expand .el-form-item {
  margin-right: 0;
  margin-bottom: 0;
  width: 80%;
}
</style>
